<?php include_partial('account_menu',array('active_tab'=>'releases'))?>

<div class="account_content">
<div class='righttext'><?php echo link_to('Добавить релиз','account/addrelease') ?></div>
<div class='releases'>

<?php
$res = $pager->getResults();
 if (count($res)) { ?>
<table cellspacing='0' class='myreleasestable'>
<tr>
<th>Название</th>
<th width="30">Опубликован</th>
<th>Коротко</th>
<th></th>
</tr>
<?php
foreach($res as $rel)
{ ?>
<tr>
<td>
<?php echo $rel->getTitle() ?>
</td>
<td>
<?php echo $rel->getIsPublished()? 'да':'нет' ?>
</td>
<td>
<?php echo $rel->getShort() ?>
</td>
<td width="50">
<?php echo link_to('редактировать','account/editrelease?relid='.$rel->getId()).'/'.link_to('удалить', 'account/deleterelease?relid='.$rel->getId()) ?>
</td>
</tr>
<?php } ?>
</table>
<?php } ?>
</div>


<div style='text-align:right'>
<?php if($pager->haveToPaginate()){
	// first arrow
	if ($pager->getPage()>1)	
	echo link_to("&larr; ",'account/myreleases?page='.($pager->getPage()-1),array('style' => 'text-decoration:none'));
	else echo '&larr; ';
	
for ($i=1; $i<=$pager->getLastPage(); $i++)
{
	echo $i != $pager->getPage() ? link_to("$i ",'account/myreleases?page='.$i,array('style' => 'text-decoration:none')) : "$i ";
}
	
	// last arrow
	if ($pager->getPage()<$pager->getLastPage())	
	echo link_to("&rarr; ",'account/myreleases?page='.($pager->getPage()+1),array('style' => 'text-decoration:none'));
	else echo '&rarr;';
} ?>
</div>
 
</div>